get_acorn() {
    # arch="$(uname -m)"
    arch="amd64"
    acorn_version=$(curl -s https://api.github.com/repos/acorn-io/runtime/tags | jq -r '.[0].name')
    file_name="acorn-${acorn_version}-linux-${arch}.tar.gz"
    cli="acorn"
    bin_path="/usr/local/bin"
    sudo rm -rf ${bin_path}/${cli}
    wget https://ghproxy.net/https://github.com/acorn-io/runtime/releases/download/${acorn_version}/${file_name}
    tar -zxvf ${file_name}
    # mv ${file_name} ${cli}
    # chmod +x ${cli}
    sudo mv ${cli} ${bin_path}
    rm -rf LICENSE README.md ${file_name}
}

get_acorn
